package com.zhangyu.shadow.core.account;

import com.zhangyu.shadow.core.util.storage.ShadowPreference;

/**
 * @author zhangyu
 * @date 2017/10/26
 */

public class AccountManager {
    private enum SignTag{
        SIGN_TAG
    }

    public static void setSignState(boolean state){
        ShadowPreference.setAppFlag(SignTag.SIGN_TAG.name(),state);
    }
    private static boolean isSignIn(){
        return ShadowPreference.getAppFlag(SignTag.SIGN_TAG.name());
    }

    public static void checkAccount(IUserChecker checker){
        if(isSignIn()){
            checker.onSignIn();
        }else{
            checker.onNotSignIn();
        }
    }
}
